package org.example.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.example.entity.info_notice;
import org.example.mapper.info_noticeMapper;
import org.example.service.info_noticeSerive;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class info_noticeSeriveImpl implements info_noticeSerive{
    @Autowired
    private info_noticeMapper info_noticeMapper;

    @Override
    public PageInfo<info_notice> getinfo_noticeById(info_notice info_notice, int page, int size) {
        PageHelper.startPage(page, size);
        List<info_notice> infoNotices = info_noticeMapper.getinfo_noticeById(info_notice);
        PageInfo<info_notice> pageInfo = new PageInfo<>(infoNotices);
        return pageInfo;
    }
}
